package com.fastloan.mgt.application.contract.service.impl.loanmode.mode.ry.enmus;

/**
 * 融钰还款计划状态
 *
 * @author yanwe
 * createTime 2018-01-2018/1/15 9:27
 */
public enum RyRepaymentStatus {

    NO_REPAYMENT("1","未还款"),
    CREATE_REPAYMENT("2","创建还款"),
    REPAYMENT_FAIL("3","还款失败"),
    IS_REPAYMENT("4","已还款"),
    OVERDUE("5","逾期中");

    private String status;

    private String statusName;

    RyRepaymentStatus(String status, String statusName) {
        this.status = status;
        this.statusName = statusName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public static RyRepaymentStatus getRepaymentByStatus(String status){
        switch (status){
            case "1":
                return NO_REPAYMENT;
            case "2":
                return CREATE_REPAYMENT;
            case "3":
                return REPAYMENT_FAIL;
            case "4":
                return IS_REPAYMENT;
            case "5":
                return OVERDUE;
            default:
                throw new IllegalArgumentException("未知的融钰还款计划状态:"+status);
        }

    }
}
